<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
    <div class="col-sm-7 col-md-8 col-lg-9">
        <div class="" style="margin-top:0;">
            <div class="panel">
                </header>
                <div class="panel-heading">
                    <span>公司员工</span>
                </div>
                <style>
                    .table-custom{ border:1px solid #ccc; border-collapse:separate; border-radius:5px; overflow:hidden;}
                    .table-custom tr{ color:#666;}
                    .table-custom thead th{ padding:14px !important; background:linear-gradient(to bottom,#fdfdfd 30%,#e9e9e9); text-align:center;}
                    .table-custom tr td{line-height: 36px !important;padding-top: 15px !important;padding-left: 15px !important; border-top:none !important;}
                    .table-custom tr img{ border:1px solid #ccc; margin-right:0px;}
                    .table-custom tr .social-links{ margin:5px 0;}
                    .tree-box{ min-height:32px;}
                    .tree-custom{position: absolute !important;background: #fff; transition:all 0.2s; width:96%; z-index:1;box-shadow: 1px 1px 4px rgba(0,0,0,0.14);}
                    .tree-custom:before{ border:none !important;}
                </style>
                <div class="panel-body">
                    <style>
                        .u6VcSc{color: #212121;min-height: 110px;width: 284px;-webkit-box-sizing: border-box;box-sizing: border-box;padding: 32px 24px 24px 24px;position: relative;}
                        .utPnCc{opacity: 1; visibility: visible; width:278px; height:auto;box-shadow: 0 1px 4px 0 rgba(0,0,0,0.14);}
                        .E68jgf{padding-top: 28.17%;position: relative;height: 0;width: 100%;overflow: hidden;}
                        .E68jgf img{position: absolute;display: block;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: auto;margin: auto;}
                        .CZrKtf{ -webkit-border-radius: 50%;border-radius: 50%;display: inline-block;position: absolute;top: -20px;}
                        .Y7OA7b{font: 500 14px Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size: 18px;line-height: 20px;}
                        .RJuGvc{font: 400 14px Roboto,RobotoDraft,Helvetica,Arial,sans-serif;min-height: 18px;}
                        .VHmGZd{font: 400 12px Roboto,RobotoDraft,Helvetica,Arial,sans-serif;line-height: 18px; padding-top:20px;}
                    </style>
                    <div class="tab-content directory-info-row">
                        <div class="tab-pane active " id="home">
                            <table class="table  table-hover general-table table-custom table-striped">
                                <thead>
                                <tr>
                                    <th align="center" style="display:none;">勾选</th>
                                    <th> 姓名</th>
                                    <th class="hidden-phone">角色</th>
                                    <th>职位</th>
                                    <th class="hidden-sm hidden-xs">联系电话</th>
                                    <th class="hidden-md hidden-sm hidden-xs">QQ</th>
                                    <th class="hidden-md hidden-sm hidden-xs">Email</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody class="" id="ajaxlistbox">
                                <?php }?>
                                <?php if(IS_AJAX){?>
                                <!-- 数据主体 -->
                                <volist name="list" id="vo">
                                    <tr>
                                        <td align="center" style="position:relative; display:none;"><div class="BatchOperation BatchOperationBtn td">
                                            <input class="checkbox" type="checkbox" name="id[]" value="{$vo.id}">
                                            <i class="fa icon-check td"></i>
                                            <div class="fabg td"></div>
                                        </div></td>
                                        <td style="position:relative;"><div class="utPnCc" style="position:absolute; display:none; z-index:4; background:#fff;"> <a class="A1qsEd">
                                            <div class="E68jgf"> <img src="__PUBLIC__/Intesys/default/images/green2.jpg" height="80" width="284" alt="个人资料封面照片"> </div>
                                        </a>
                                            <div class="u6VcSc"> <a class="A1qsEd"> <img src="<empty name="vo['img_url']">/Public/timg.jpg
                                                <else/>
                                                {$vo.img_url}
                                                </empty>
                                                " width="40" height="40" class="CZrKtf" alt="个人资料照片"> </a>
                                                <div class="Y7OA7b"> <a href="javascript:void(0);" class="A1qsEd">{$vo.name}</a>
                                                    <div class="RJuGvc">这个人很懒 什么都没有留下</div>
                                                </div>
                                                <div class="VHmGZd FdEWOb">
                                                    <div>QQ: {$vo.QQ}</div>
                                                    <div>Email: {$vo.Email}</div>
                                                    <div>联系电话: {$vo.tel}</div>
                                                </div>
                                            </div>
                                        </div>
                                            <img class="media-object pull-left bubble" width="40" src="<empty name="vo['img_url']">/Public/timg.jpg
                                            <else/>
                                            {$vo.img_url}
                                            </empty>
                                            " alt=""> <span class="pull-right">{$vo.name}</span></td>
                                        <td>{:$groupList[$vo['group_id']]}</td>
                                        <td><?php $arr=explode(',',$vo['memberpositionid']);foreach($arr as $v){echo($positionList[$v]);}?></td>
                                        <td class="hidden-sm hidden-xs">{$vo.tel}</td>
                                        <td class="hidden-md hidden-sm hidden-xs">{$vo.QQ}</td>
                                        <td class="hidden-md hidden-sm hidden-xs">{$vo.Email}</td>
                                        <td><ul class="social-links">
                                            <li>
                                                <!--增加权限控制2016-11-29 by：zmx-->
                                                <if condition="getAccessMenu($accessList, 'Intesys', 'Analysis', 'block')"> <a title="他的积分" data-placement="top" data-toggle="tooltip" class="tooltips" href="javascript:void(0);" onClick="_openWindow('{:U('Analysis/block',['member'=>$vo['id']])}',900,'个人动态','取消',null,'')" data-original-title="他的积分"><i class="fa icon-smile-o"></i></a> </if>
                                                <!--增加权限控制2016-11-29 by：zmx-->
                                                <if condition="getAccessMenu($accessList, 'Intesys', 'Info_remind', 'chat')"> <a title="发信息" data-placement="top" data-toggle="tooltip" class="tooltips" href="javascript:void(0);" onClick="_openWindow('{:U('Info_remind/chat')}',650,'发信息','退出',null,'')" data-original-title="给他发信息"><i class="fa icon-comments-o"></i></a> </if>
                                                <!--增加权限控制2016-11-29 by：zmx-->
                                                <if condition="getAccessMenu($accessList, 'Intesys', 'Info', 'index')"><a title="个人动态" data-placement="top" data-toggle="tooltip" class="tooltips" href="javascript:void(0);" onClick="_openWindow('{:U('Info/index',['member_id'=>$vo['id']])}',650,'个人动态','取消',null,'')" data-original-title="他的动态"><i class="fa icon-hand-o-up"></i></a> </if>
                                                <!--增加权限控制2016-11-29 by：zmx-->
                                                <if condition="getAccessMenu($accessList, 'Intesys', 'Employee', 'edit')"><a title="修改员工信息" data-placement="top" data-toggle="tooltip" class="tooltips" href="javascript:void(0);" onClick="_openWindow('{:U('Employee/edit',['id'=>$vo['id']])}',650,'修改员工信息','保存',function(){ },'')" data-original-title="修改员工信息"><i class="fa icon-edit"></i></a></if>
                                            </li>
                                        </ul></td>
                                    </tr>
                                </volist>
                                <?php }?>
                                <!-- 数据主体结束 -->
                                <?php if(!IS_AJAX){?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="PagesBox" id="ajaxlistboxpages"><?php echo $pages;?></div>
    </div>
    <div class="col-sm-5 col-md-4 col-lg-3">
        <div class="affixelement">
            <div class=" states-info" style="cursor:pointer">
                <!--增加权限控制2016-11-29 by：zmx-->
                <if condition="getAccessMenu($accessList, 'Intesys', 'Member_group', 'add')">
                    <div class="panel green-bg" id="ajaxlistboxaddbtn"  width="500" title="增加员工" rel="<?php echo U('Employee/add'); ?>">
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-xs-3"> <i class="fa icon-hand-o-right"></i> </div>
                                <div class="col-xs-7">
                                    <h4>增加员工</h4>
                                    <span class="state-title"> <a class="text-success" href="##" style="text-decoration: none;">点击这里增加员工</a> </span> </div>
                                <div class="col-xs-2"> <span class="fa icon-angle-right"></span> </div>
                            </div>
                        </div>
                    </div>
                </if>
            </div>
            <div class="panel">
                <header class="panel-heading"> 搜索员工<a href="##" id="ajaxlistboxbob" class="pull-right">批量操作</a> </header>
                <div class="panel-body">
                    <div class="form-group" id="ajaxlistboxboc" style="display:none;"><a href="##" class="btn btn-info" id="ajaxlistboxsa">全选</a> <a href="##" class="btn btn-info" id="ajaxlistboxca">全不选</a> <a href="##" class="btn btn-info" id="ajaxlistboxsar">反选</a> <a rel="{:U('delete')}" href="##" class="btn btn-danger bdeleteBtn">删除选中</a></div>
                    <form id="ajaxlistboxform" action="<?php echo U('index');?>">
                        <div class="input-group m-bot15">
                            <input type="text" name="keywords" class="form-control" placeholder="请输入关键词匹配搜索">
                          <span class="input-group-btn">
                            <button type="button" onClick="$('#ajaxlistboxform').submit();" class="btn btn-default"><i class="fa icon-search"></i></button>
                          </span>
                        </div>
                    </form>
                    <!--
                    <div class="col-sm-4 col-lg-3 tree-box">
                        <div id="FlatTree" class="tree tree-plus-minus tree-custom">
                            <div class = "tree-folder" style="display:none;">
                                <div class="tree-folder-header"> <i class="fa fa-folder"></i>
                                    <div class="tree-folder-name"></div>
                                </div>
                                <div class="tree-folder-content"></div>
                                <div class="tree-loader" style="display:none"></div>
                            </div>
                            <div class="tree-item" style="display:none;"> <i class="tree-dot"></i>
                                <div class="tree-item-name"></div>
                            </div>
                        </div>
                    </div> -->
                </div>
            </div>
        </div>
    </div>
</div>
<include file="Public:script" />
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/nanoscroller.min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/tether.min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/config.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/util.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/jquery.emojiarea.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/emoji-picker.js"></script>
<script src="__PUBLIC__/Js/highcharts.src.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/css/default.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/bootstrap/css/font-awesome.min.css">
<link href="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/css/nanoscroller.css" rel="stylesheet">
<link href="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/css/emoji.css" rel="stylesheet">
<script>

    var TreeView = function () {

        return {
            //main function to initiate the module
            init: function () {

                var DataSourceTree = function (options) {
                    this._data  = options.data;
                    this._delay = options.delay;
                };

                DataSourceTree.prototype = {

                    data: function (options, callback) {
                        var self = this;
                        var data = $.extend(true, [], self._data);
                        var parent_id = 0;
                        if("type" in options && options.type == "folder") {
                            parent_id = options.additionalParameters['id'];
                        }







                        //请求数据
                        $.get('{:U('Member_position/tree')}', {pid:parent_id}, function(data1){
                            callback({ data: data1 });
                            //更新员工列表
                            $('#FlatTree .tree-item').unbind('click');
                            $('#FlatTree .tree-item').each(function(index, element) {

                                $(this).click(function(e) {
                                    if(!$(this).hasClass('tree-selected')){
                                        $('#ajaxlistboxform').append('<input type="hidden" value="'+$(this).attr('itemid')+'" id="member_position_id'+$(this).attr('itemid')+'" name="member_position_id[]">');
                                    }else{
                                        $('#ajaxlistboxform').find('#member_position_id'+$(this).attr('itemid')).remove();
                                    }
                                    $("#ajaxlistboxform").submit();
                                    searchform(document.getElementById('checkform'));
                                });



                            });


                        },'json');


                    }
                };

                // INITIALIZING TREE
                var treeDataSource = new DataSourceTree({
                    data: [],
                    delay: 0
                });





                $('#FlatTree').tree({
                    dataSource: treeDataSource,
                    selectable: 1,
                    multiSelect: 1,
                    loadingHTML: '<img src="__PUBLIC__/Intesys/AdminX/images/input-spinner.gif"/>',
                });




            }

        };

    }();


    jQuery(document).ready(function() {
        TreeView.init();
    });



    $('#ajaxlistbox').ajaxlist({success:function(){ $('[data-toggle="tooltip"]').tooltip(); }});
</script>
<style>
    .states-info i.fa.fa-folder,.states-info i.fa.fa-folder-open,.states-info i.tree-dot{font-size:12px;}

</style>
</body></html><?php }?>